import java.util.ArrayList;

import staticdemo3.Student;

public class Test {
    public static void main(String[] args) {
        // 创建一个集合来储存学生对象
        ArrayList<Student> list = new ArrayList<>();
        // 创建三个学生
        Student s1 = new Student(18, "A", "NAN");
        Student s2 = new Student(20, "B", "NV");
        Student s3 = new Student(21, "C", "NAN");
        // 学生对象添加到学生对象中
        list.add(s1);
        list.add(s2);
        list.add(s3);
        // 调用工具类的方法
        int MaxAgeStudent = StudentUtil.getMaxAgeStudent(list);
        System.out.println(MaxAgeStudent);
    }
}